﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Microsoft.Xna.Framework;
using System.Collections.ObjectModel;

namespace Oroboros.Save_Data
{
    public class HumanSaveData : INotifyPropertyChanged
    {
        private Guid _Guid;
        private int _Age;
        private string _BaseMovementStatsName = string.Empty;
        private Vector3 _BasePlacement = new Vector3(float.MaxValue);
        private CharacterStatsSaveData _CurrentStats;
        private Guid _EquippedWeapon = Guid.Empty;
        private ObservableCollection<int> _FailedChecks = new ObservableCollection<int>();
        private string _Family = string.Empty;
        private string _FormalDisplayName = string.Empty;
        private string _FormerOccupation = string.Empty;
        private HealthSaveData _Health;
        private int _InfectionStage;
        private InventorySaveData _Inventory;
        private bool _IsWorkingInLitEnvironment;
        private LiveStatus _LivingStatus;
        private string _ModelName = string.Empty;
        private float _ModelScale = 1f;
        private int _MoraleRating;
        private string _Name = string.Empty;
        private int _NumberOfDaysWithOutFood;
        private bool _RecruitedOnMission;
        private Gender _Sex;
        private ObservableCollection<SkillSaveData> _Skills = new ObservableCollection<SkillSaveData>();
        private Guid _Task = Guid.Empty;
        private string _TemplateName = string.Empty;
        private HumanType _Type = HumanType.AbleBodied;

        public Guid EquippedWeapon { get { return _EquippedWeapon; } set { Changed("EquippedWeapon"); _EquippedWeapon = value; } }
        public HealthSaveData Health { get { return _Health; } set { Changed("Health"); _Health = value; } }
        public InventorySaveData Inventory { get { return _Inventory; } set { Changed("Inventory"); _Inventory = value; } }
        public string Name { get { return _Name; } set { Changed("Name"); _Name = value; } }
        public string FormalDisplayName { get { return _FormalDisplayName; } set { Changed("FormalDisplayName"); _FormalDisplayName = value; } }
        public CharacterStatsSaveData CurrentStats { get { return _CurrentStats; } set { Changed("CurrentStats"); _CurrentStats = value; } }
        public ObservableCollection<SkillSaveData> Skills { get { return _Skills; } set { Changed("Skills"); _Skills = value; } }
        public string BaseMovementStatsName { get { return _BaseMovementStatsName; } set { Changed("BaseMovementStatsName"); _BaseMovementStatsName = value; } }
        public string TemplateName { get { return _TemplateName; } set { Changed("TemplateName"); _TemplateName = value; } }
        public string Family { get { return _Family; } set { Changed("Family"); _Family = value; } }
        public LiveStatus LivingStatus { get { return _LivingStatus; } set { Changed("LivingStatus"); _LivingStatus = value; } }
        public string FormerOccupation { get { return _FormerOccupation; } set { Changed("FormerOccupation"); _FormerOccupation = value; } }
        public string ModelName { get { return _ModelName; } set { Changed("ModelName"); _ModelName = value; } }
        public float ModelScale { get { return _ModelScale; } set { Changed("ModelScale"); _ModelScale = value; } }
        public int Age { get { return _Age; } set { Changed("Age"); _Age = value; } }
        public Gender Sex { get { return _Sex; } set { Changed("Sex"); _Sex = value; } }
        public HumanType Type { get { return _Type; } set { Changed("Type"); _Type = value; } }
        public int MoraleRating { get { return _MoraleRating; } set { Changed("MoraleRating"); _MoraleRating = value; } }
        public bool RecruitedOnMission { get { return _RecruitedOnMission; } set { Changed("RecruitedOnMission"); _RecruitedOnMission = value; } }
        public int NumberOfDaysWithOutFood { get { return _NumberOfDaysWithOutFood; } set { Changed("NumberOfDaysWithOutFood"); _NumberOfDaysWithOutFood = value; } }
        public int InfectionStage { get { return _InfectionStage; } set { Changed("InfectionStage"); _InfectionStage = value; } }
        public bool IsWorkingInLitEnvironment { get { return _IsWorkingInLitEnvironment; } set { Changed("IsWorkingInLitEnvironment"); _IsWorkingInLitEnvironment = value; } }
        public ObservableCollection<int> FailedChecks { get { return _FailedChecks; } set { Changed("FailedChecks"); _FailedChecks = value; } }
        public Guid Task { get { return _Task; } set { Changed("Task"); _Task = value; } }
        public Vector3 BasePlacement { get { return _BasePlacement; } set { Changed("BasePlacement"); _BasePlacement = value; } }
        public Guid Guid { get { return _Guid; } set { Changed("Guid"); _Guid = value; } }

        public event PropertyChangedEventHandler PropertyChanged;
        public void Changed(string n)
        {
            if (PropertyChanged == null) return;
            if (!string.IsNullOrEmpty(n))
                PropertyChanged(this, new PropertyChangedEventArgs(n));
        }

        public override string ToString()
        {
            return string.Format("{0}", Name);
        }
    }
}
